package net.atos.spring;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

@Entity
public class Author {

    @Id
    private Long id;
    private String name;
    private String surname;

    @ManyToMany
    private Collection<Book> books;

    public Author() {
	super();
    }

    public Author(String name, String surname) {
	super();
	this.name = name;
	this.surname = surname;
    }

    @Override
    public String toString() {
	return "Author [id=" + id + ", name=" + name + ", surname=" + surname + ", books=" + books + "]";
    }

    public Long getId() {
	return id;
    }

    public void setId(Long id) {
	this.id = id;
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public String getSurname() {
	return surname;
    }

    public void setSurname(String surname) {
	this.surname = surname;
    }

    public Collection<Book> getBooks() {
	return books;
    }

    public void setBooks(Collection<Book> books) {
	this.books = books;
    }
}
